import type {
  StudentAddDTOType,
  StudentUpdateDTOType,
  StudentSearchDTOType,
} from '@/resources/interface/student/StudentTypes'
import type { TableColumn } from '@/components/CommonTable.vue'
import { ComponentEnum, type FormItemConfig } from '@/components/CommonDialogForm.vue'

/**
 * 学生表 参数对象
 */
export class StudentParams {
  /**
   * 表单参数
   */
  static formColumn: FormItemConfig[] = [
    {
      label: '学生姓名',
      prop: 'studentName',
      type: ComponentEnum.INPUT,
      field: 'studentName',
    },
    {
      label: '学号',
      prop: 'studentNumber',
      type: ComponentEnum.INPUT,
      field: 'studentNumber',
    },
    {
      label: '班级',
      prop: 'className',
      type: ComponentEnum.INPUT,
      field: 'className',
    },
    {
      label: '专业',
      prop: 'major',
      type: ComponentEnum.INPUT,
      field: 'major',
    },
    {
      label: '入学年份',
      prop: 'enrollmentYear',
      type: ComponentEnum.INPUT,
      field: 'enrollmentYear',
    },
  ]
  /**
   * 表格参数
   */
  static tableColumn: TableColumn[] = [
    {
      label: '学生姓名',
      field: 'studentName',
    },
    {
      label: '学号',
      field: 'studentNumber',
    },
    {
      label: '班级',
      field: 'className',
    },
    {
      label: '专业',
      field: 'major',
    },
    {
      label: '入学年份',
      field: 'enrollmentYear',
    },
    {
      label: '操作',
      field: 'right',
      attribute: {
        fixed: 'right',
        width: '200px',
      },
      template: {
        options: [
          {
            icon: 'edit',
            type: 'primary',
            size: 'small',
            method: 'update',
          },
          {
            icon: 'delete',
            type: 'danger',
            size: 'small',
            method: 'remove',
          },
        ],
      },
    },
  ]
  /**
   * 添加对象
   */
  static addDTO: StudentAddDTOType = {
    userId: 0,
    studentNumber: '',
    studentName:'',
    className: '',
    major: '',
    enrollmentYear: '',
  }
  /**
   * 修改对象
   */
  static updateDTO: StudentUpdateDTOType = {
    id: 0,
    userId: 0,
    studentNumber: '',
    className: '',
    studentName:'',
    major: '',
    enrollmentYear: '',
  }
  /**
   * 查询对象
   */
  static searchDTO: StudentSearchDTOType = {
    studentNumber: '',
    className: '',
    major: '',
    studentName: '',
    page: {
      current: 1,
      size: 20,
    },
  }
}
